.TH std::experimental::packaged_task(libraryfundamentalsTS) 3 "2024.06.10" "http://cppreference.com" "C++ Standard Libary"
.SH NAME
std::experimental::packaged_task(libraryfundamentalsTS) \- std::experimental::packaged_task(libraryfundamentalsTS)

.SH Synopsis
   Defined in header <experimental/future>
   template< class > class packaged_task; //not defined \fB(1)\fP (library fundamentals TS)
   template< class R, class ...Args >                   \fB(2)\fP (library fundamentals TS)
   class packaged_task<R(Args...)>;

   std::experimental::fundamentals_v1::packaged_task (and
   std::experimental::fundamentals_v2::packaged_task) is a modified version of
   std::packaged_task provided by the library fundamentals TS with support for
   type-erased allocators.

.SH Member types

   Member type    Definition
   allocator_type std::experimental::erased_type

.SH Member functions

   constructor         constructs the task object
                       \fI(public member function)\fP
                       retrieves a pointer to the memory resource used by this object
   get_memory_resource to allocate memory
                       \fI(public member function)\fP

   Non-member function

                                                             specializes the swap
   std::experimental::swap(std::experimental::packaged_task) algorithm
                                                             \fI(function template)\fP

.SH Helper classes

                                                         specializes the
   std::uses_allocator<std::experimental::packaged_task> std::uses_allocator type trait
                                                         (class template
                                                         specialization)

Members identical to std::packaged_task

.SH Member functions

                             destructs the task object
   destructor                \fI(public member function of std::packaged_task<R(Args...)>)\fP

                             moves the task object
   operator=                 \fI(public member function of std::packaged_task<R(Args...)>)\fP

                             checks if the task object has a valid function
   valid                     \fI(public member function of std::packaged_task<R(Args...)>)\fP

                             swaps two task objects
   swap                      \fI(public member function of std::packaged_task<R(Args...)>)\fP

.SH Getting the result
                             returns a std::future associated with the promised result
   get_future                \fI(public member function of std::packaged_task<R(Args...)>)\fP

.SH Execution
                             executes the function
   operator()                \fI(public member function of std::packaged_task<R(Args...)>)\fP

                             executes the function ensuring that the result is ready
   make_ready_at_thread_exit only once the current thread exits
                             \fI(public member function of std::packaged_task<R(Args...)>)\fP

                             resets the state abandoning any stored results of previous
   reset                     executions
                             \fI(public member function of std::packaged_task<R(Args...)>)\fP

